<template>
	<view class="pollutants-licence">
		<titleName :name="name" :backShow="true"></titleName>
		<view class="search-wrap">
			<view class="ipt-wrap">
				<input type="text" placeholder="搜索企业名称" placeholder-class="ph-color" />
				<button class="btn">查询</button>
			</view>
		</view>

		<view class="content-wrap">
			<view class="total-num">
				共<text>{{enterpriseList.length}}</text>个单位
			</view>
			<view class="list">
				<view class="item" v-for="item in enterpriseList" :key="item.id" @click="jumpDetail(item.id)">
					<view class="title">
						<view class="name">企业名称：{{item.customername}}</view>
						<image :src="resourceUrl+'right-arrow.png'" mode=""></image>
					</view>
					<view class="onwer">
						法定代表人：{{item.owner}}
					</view>
					<view class="manage-user">
						环保管理员：{{item.hbperson || item.hbpersonsecond}}
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script setup>
	import titleName from '../../components/titleName.vue'
	import http from '../../request/index.js'
	import {
		resourceUrl
	} from '../../request/config'
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app'
	import {
		ref
	} from 'vue'
	let enterpriseList = ref([])
	let name = "排污许可"
	onShow(() => {
		http({
			url: "/enterprise/datalist_issimple" //"/enterprise/datalist"
		}).then((res) => {
			if (res.code == 0) {

				enterpriseList.value = res.data.list
			}
		})
	})
	let jumpDetail = (id) => {
		uni.navigateTo({
			url: `/homePageOther/pollutantslicencedetail/index?id=${id}`
		})
	}
</script>

<style lang="scss" scoped>
	.pollutants-licence {
		width: 100vw;
		height: 100vh;

		:deep(.ph-color) {

			font-family: Source Han Sans CN;
			font-weight: 400;
			font-size: 25rpx;
			color: #ABABBB;

		}

		.content-wrap {
			height: calc(100vh - 160upx - 131upx);
			background: #F3F5F7;

			.total-num {
				display: flex;
				align-items: center;
				height: 56upx;
				padding-left: 45upx;

				font-family: Source Han Sans CN;
				font-weight: 400;
				font-size: 23rpx;
				color: #333333;


				text {
					color: #0874FA;
				}
			}

			.list {
				height: calc(100vh - 160upx - 56upx - 131upx);
				padding: 0 22upx 100upx 22upx;
				overflow: scroll;

				.item:first-child {
					margin-top: 0 !important;
				}

				.item {
					margin-top: 22upx;
					width: 100%;
					height: 227rpx;
					background: #FFFFFF;
					border-radius: 14rpx;
					padding: 32upx 30upx 0 42upx;

					.title {
						display: flex;
						align-items: center;

						.name {

							font-family: Source Han Sans CN;
							font-weight: 500;
							font-size: 31rpx;
							color: #222222;

							width: 100%;
							white-space: nowrap;
							overflow: hidden;
							text-overflow: ellipsis;
						}

						image {
							width: 15rpx;
							height: 25rpx;
							flex-shrink: 0;
						}
					}

					.onwer {
						margin-top: 25upx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						font-size: 28rpx;
						color: #666666;

					}

					.manage-user {
						margin-top: 25upx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						font-size: 28rpx;
						color: #666666;

					}
				}
			}
		}





		.search-wrap {
			width: 750rpx;
			height: 131rpx;
			background: #FFFFFF;
			display: flex;
			align-items: center;
			justify-content: center;

			.ipt-wrap {
				display: flex;
				width: 690rpx;
				height: 75rpx;
				background: #F7F7FE;
				border-radius: 38rpx;
				padding-left: 34upx;
				align-items: center;

				input {
					flex-grow: 1;
					padding-right: 100upx;
				}



				.btn {
					flex-shrink: 0;
					width: 112rpx;
					height: 74rpx;
					background: #0874FA;
					border-radius: 14rpx;
					line-height: 74upx;
					font-weight: 500;
					font-size: 31rpx;
					color: #FFFFFF;
				}
			}

		}



	}
</style>